<template>
  <div id="app">
    <div class="login">
      <select v-model="input">
        <option value="1">张三</option>
        <option value="2">李四</option>
        <option value="3">王五</option>
      </select>
      <button @click="confirm">确定</button>
    </div>
    <Chat :username='username'></Chat>
  </div>
</template>

<script>

  import Chat from './components/Chat'
  export default {
    name: 'App',
    components: {
      Chat
    },
    data() {
      return {
        input: '',
        username: ''
      }
    },
    methods: {
      confirm() {
        this.username = this.input
      }
    },
  }
</script>

<style scoped>
  .login {
    margin-top: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  select,
  button {
    outline: none;
  }

  select {
    width: 100px;
    height: 23px;
  }
</style>